<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link rel="stylesheet" type="text/css" href="<?php echo $this->_webroot('skin/css/admin.css'); ?>">
<link rel="stylesheet" type="text/css" href="<?php echo $this->_webroot('skin/css/main.css'); ?>">

<script language="JavaScript" src="<?php echo $this->_webroot('skin/js/jy.js'); ?>"></script>
<script type='text/javascript' src='<?php echo $this->_webroot('servtools/date/WdatePicker.js'); ?>'></script>
<style>
td span {color:red;}
.green {color:green;}
.red {color:red;}
</style>
</head>
<body>
<input type="hidden" id="update_right" value="1" ></input>
<div id="maincontent">
<psp:tags     htmlname='messagebox'  iconname='messagebox' />
	<div class="wrap">
    <div class="crumbs">当前位置 &gt;&gt; 用户管理 &gt;&gt; 会员列表</div>
        <hr />
		<div class="seachbox">
			<div class="content2">
				<form action="<?php echo $this->_url('admin/user/index/');?>" name="searchForm" method="get">
					<table class="form-table">
						<tbody>
							<tr>
								<td width="2px" style="padding:0 0 0 5px"><span style="margin:1px 0px 0px 0px; float:left; color: #000" > <img src="<?php echo $this->_webroot('skin/images/icon_search.gif'); ?>" border="0" alt="SEARCH" /> </span></td>
								<td >会员名称： <input type="text" class="small-text" name="name" value="<?php echo $name; ?>" style="width:100px" /> 
								会员邮箱：<input type="text" class="small-text" name="email" value="<?php echo $email; ?>" style="width:100px" /> 
								&nbsp;&nbsp;会员状态：
									<select name='user_status'>
										<option value ="2">全部</option>
										<option value ="0" <?php if($user_status=='0') echo "selected"?>>正常</option>
										<option value ="1" <?php if($user_status=='1') echo "selected"?>>锁定</option>
									</select>
									会员类型：
									<select name='user_rank_id'>
										<option value ="0">选择分类</option>
										<?php
							foreach($userrank as $value) {?>
										<option value ="<?php echo $value['id'];?>" <?php if($user_rank_id==$value['id']) echo "selected"?>><?php echo $value['rank_name'];?></option>
										<?php } ?>
									</select>
								</td>
							</tr>
							<tr>
								<td></td>
								<td > 创建时间： <input class="Wdate" type="text" name="start_time" id="start_time" onFocus="WdatePicker({isShowClear:false,readOnly:true})" value="<?php echo $start_time;?>" />至 <input class="Wdate" type="text" name="end_time" id="end_time" onFocus="WdatePicker({isShowClear:false,readOnly:true})"  value="<?php echo $end_time;?>"/> 
									&nbsp;&nbsp;<input type="submit" class="regular-button" value="搜索" /></td>
							</tr>
						</tbody>
					</table>
				</form>
			</div>
		</div>		
		
		
	<div class="infobox">
    <h3>会员列表</h3>
    <div class="content2">
				<form action="m.php?app=member_list" id="form1" method="get">
					<table class="list_table">
						<thead>
                            <tr style="text-align:center;">
								<th width="2x"><input type="checkbox" value="" onclick="checkall(this,'user_id[]');"></th>
								<th width="160px" align="left">会员名称/会员邮箱</th>
								<th width="275px">注册时间 / 最后登陆时间</th>
								<th width="110px">最后登陆IP</th>
								<th width="276px">邮箱验证/会员级别</th>
								<th width="45px">状态</th>
								<th width="80px">操作</th>
							</tr>
						</thead>
						<tbody>
							<?php if($result['data']) {
			foreach($result['data'] as $value) { $value= $value['user'];?>
							<tr style=" text-align:center;">
								<td><input type="checkbox" name="user_id[]" value="<?php echo $value['id'];?>" /></td>
								<td align="left"><?php echo $value['username'];?><br />
									<?php echo $value['email'];?></td>
								<td><?php echo $value['reg_time'];?><br />
									<?php echo $value['last_login_time'];?></td>
								<td><?php echo $value['last_ip'];?></td>
								<?php if($value['isemail']){?>
								<td class="green center">已验证<br />
									<?php echo $userrank[$value['rank_id']]['rank_name'];?></td>
								<?php }else{?>
								<td class="red center">未验证<br />
									<?php echo $userrank[$value['rank_id']]['rank_name'];?></td>
								<?php }?>
								<td class="center"><?php if(@$value['locked']==1) { echo "<span style='color:red;'>锁定</span>"; }else { echo "<span style='color:green;'>正常</span>"; } ?></td>
								<td class="center">
								<a href="<?php echo $this->_url('admin/user/money/'.$value['id']);?>">充值</a><br />
								  <a href="<?php echo $this->_url('admin/user/edit/'.$value['id']);?>">修改</a><br />
									<?php if(@$value['locked']==1) { ?>
									<a href="<?php echo $this->_url('admin/user/unlocked/');?>?id=<?php echo $value['id'];?>" onclick="return confirm('解除锁定后会员将可以恢复登陆，确认要解除锁定吗?');">解除锁定</a>
									<?php }else { ?>
									<a href="<?php echo $this->_url('admin/user/locked/');?>?id=<?php echo $value['id'];?>" onclick="return confirm('锁定后会员将不能登陆，确认要锁定吗?');">锁定</a>
									<?php } ?>
									
									</td>
							</tr>
							<?php }?>
							<tr>
								<td colspan="10"><span class="button-container"><input class="regular-button" type='button' onclick='jump_diff("<?php echo $this->_url('admin/user/locked/');?>");' name="" value="批量锁定"  /></span> 
								<span class="button-container"><input class="regular-button" type='button' onclick='jump_diff("<?php echo $this->_url('admin/user/unlocked/');?>");' name="" value="批量解锁" /></span></td>
							</tr>
							<?php } else { ?>
							<tr>
								<td colspan="10"></td>
							</tr>
							<?php } ?>
							
							
                            <tr>
								<td class="center" colspan="10">共8条记录 
                            <a href="<?php echo $result['page']['head'];?>">首页</a> 
                            <a href="<?php echo $result['page']['prevPage'];?>">上一页</a> 
                            <?php foreach($result['page']['plist'] as $k => $v ) { ?>							
                            <a href="<?php echo $v; ?>"><?php echo $k; ?></a>
							<?php } ?>
                            <a href="<?php echo $result['page']['nextPage'];?>">下一页</a> 
                            <a href="<?php echo $result['page']['foot'];?>">尾页</a> 
                            当前第<?php echo $result['page']['current']['num'];?>页/共<?php echo $result['page']['pageCount'];?>页</td>
							</tr>							
							
						</tbody>
					</table>
				</form>
		
		
	  </div>
	 </div>
	</div>
</div>
<script language="JavaScript">
var inputs = document.getElementsByTagName("input");
function jump_diff(link_href){
	var checked = false; 
    for (var i = 0; i < inputs.length; i++) 
    { 
    	if (inputs[i].checked == true) 
        {
            checked = true;
            if(confirm('您确定执行此操作？')){
        		document.getElementById('form1').action=link_href;
        		document.getElementById('form1').method='post';
        		document.getElementById('form1').submit();
        		break; 
        	}else{
                	return false;
                	break; 
                    }
        }  
    } 
    if (!checked) 
    { 
        ShowMessageBox("请至少选择一个会员！",'0'); 
        return false; 
    }
}

</script>
</body>
</html>